package ar.vc.trans;

public class GetMatTrans
{
	public static float[] getIntricics(float[][] Mi)
	{
		float[] C = GetCenter.getCenter(Mi);
		
		Mi = Translate.translateTo(Mi, C);
		
		float[] Wi = GetScale.getScale(Mi, 20.0f, 10.0f);
		
		for ( int i = 0; i < 4; i++ )
		{
			Mi[i][0] *= Wi[i];
			Mi[i][1] *= Wi[i];
			Mi[i][2] += 20.0f*Wi[i];
		}
		
		float[][] R = GetMatRot.getMatRot(Mi, (float) (5.0f*Math.sqrt(2)));

		float[] T = new float[3];
		
		float Zo = Mi[0][2] + Math.abs(Mi[0][2] - Mi[2][2]);
		
		for ( int i = 0; i < 3; i++ )
		{
			T[i] = R[i][2]*(-Zo); 
		}
		
		float[] I = {T[0],T[1],T[2],
					 R[0][0],R[0][1],R[0][2],
					 R[1][0],R[1][1],R[1][2],
					 R[2][0],R[2][1],R[2][2]};
		
		return I;
	}
	
}
